package com.example.jobback.mapper;

import com.example.jobback.dto.PublishPositionDto;
import com.example.jobback.po.Position;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @InterfaceName: PositionMapper
 * @Description: 岗位mapper
 * @Author: lhb
 * @Date: 2025/5/30
 */
@Mapper
public interface PositionMapper {
    int register(Position position);

    List<Position> getPositionByUserId(Long userId);

    List<Position> getPositionByCompanyId(Long companyId);

    Position getPositionById(Long positionId);

    int deletePositionById(Long positionId);

    int updatePosition(@Param("position")Position position);

    Long getActivePositions();

    List<Position> getPositionByCompanyIds(@Param("companyIds")List<Long> companyIds);

    List<Position> getPositionByNameAndLocation(@Param("cleanedContent") String cleanedContent, @Param("location") String location);

    Long getPositionNumByCompanyId(Long companyId);

    List<Position> getPositionByLocation(String location);

    List<Position> getPositionByJobType(@Param("expectedIndustry") String expectedIndustry, @Param("location") String location);

    List<Position> getPositionsByPositionName(@Param("content") String content);

    List<String> getHotCities(@Param("num") int num);

    List<Position> getPositionByIds(@Param("positionIdList") List<Long> positionIdList);

    /**
     * @Description: 根据期望职位行业，查询公司id集合
     * @param expectedIndustry
     * @param smartCompanyMinPosition
     * @param location
     * @return List<Long>
     * @Author lhb
     * @CreateTime 2025/7/25 11:25
     */

    List<Long> smartRecommendComIdsByJobIndustry(@Param("expectedIndustry") String expectedIndustry,
                                                 @Param("smartCompanyMinPosition") int smartCompanyMinPosition,
                                                 @Param("location") String location);

    /**
     * @Description: 根据期望职位名称，查询公司id集合
     * @param expectedPosition
     * @param smartCompanyMinPosition
     * @param location
     * @return List<Long>
     * @Author lhb
     * @CreateTime 2025/7/25 11:35
     */
    List<Long> smartRecommendComIdsByPositionName(@Param("expectedPosition") String expectedPosition,
                                                  @Param("smartCompanyMinPosition") int smartCompanyMinPosition,
                                                  @Param("location") String location);

    List<Long> getPositionIdsByUserId(@Param("userId") Long userId);

    void deletePositionsByUserId(@Param("userId") Long deleteUserId);
}
